//
//  BusLineView.m
//  Clock
//
//  Created by NightElf_ZC on 16/5/4.
//  Copyright © 2016年 qianfeng. All rights reserved.
//

#import "BusLineView.h"

@implementation BusLineView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithUser:(NSString *)user
{
    self = [super init];
    if (self) {
        [self createViewWithUser:user];
    }
    return self;
}

- (void)createViewWithUser:(NSString *)user{
    NSArray * array = @[@"搜索城市：",user];
    for (int i = 0; i < 2; i++) {
        UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(15, i*40, 100, 40)];
        [self addSubview:label];
        label.text = array[i];
        label.font = [UIFont systemFontOfSize:14];
        label.textColor = [tool getColor:textColorBlack];
    }
    
    _cityTextField = [[UITextField alloc] initWithFrame:CGRectMake(115, 5, 200, 30)];
    _busLineTextField = [[UITextField alloc] initWithFrame:CGRectMake(115, 45, 200, 30)];
    
    _cityTextField.placeholder = @"请输入你要查询的城市";
    if ([user containsString:@"公交"]) {
        _busLineTextField.placeholder = @"请输入你要查询的公交线路";
    }else{
        _busLineTextField.placeholder = @"请输入你要搜索的";
    }
    
    
    _cityTextField.font = [UIFont systemFontOfSize:14];
    _busLineTextField.font = [UIFont systemFontOfSize:14];
    
    _cityTextField.backgroundColor = [UIColor whiteColor];
    _busLineTextField.backgroundColor = [UIColor whiteColor];
    
    [self addSubview:_cityTextField];
    [self addSubview:_busLineTextField];
    
}

@end
